package visitorPattern.computer

/**
 * 访问者实现,打印计算机各个部件
 */
class ComputerPartPrint : ComputerPartVisitor {
    override fun visit(computer: Computer) {
        computer.operation()
    }

    override fun visit(keyboard: Keyboard) {
        keyboard.operation()
    }

    override fun visit(mouse: Mouse) {
        mouse.operation()
    }

    override fun visit(display: Display) {
        display.operation()
    }
}